//
//  StoreUtil.m
//  JMZGO
//
//  Created by apple  on 17/7/19.
//  Copyright © 2017年 JMZ. All rights reserved.
//

#import "StoreUtil.h"

@implementation StoreUtil

+ (void)saveUserPhone:(NSString *)phone
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setValue:phone forKey:UserPhone];
    [defaults synchronize];
}

+ (NSString *)getUserPhoneNumber
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSString *phone = [defaults objectForKey:UserPhone];
    
    return phone;
    
}

+ (void)saveVtoken:(NSString *)vtoken withGuid:(NSString *)guid withApType:(NSString *)aptype
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setValue:vtoken forKey:Vtoken];
    [defaults setValue:guid forKey:Guid];
    [defaults setValue:aptype forKey:ApType];
    [defaults synchronize];

}

+ (NSString *)getVtoken
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSString *vtoken = [defaults objectForKey:Vtoken];
    
    return vtoken;
}


+ (NSString *)getGuid
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSString *guid = [defaults objectForKey:Guid];
    
    return guid;
}

+ (NSString *)getApType
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSString *apType = [defaults objectForKey:ApType];
    
    return apType;
}

+ (void)saveUserLocation:(NSDictionary *)coordinate
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setValue:coordinate forKey:UserLocation];
    [defaults synchronize];
}

+ (NSDictionary *)getUserLocation
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSDictionary *location = [defaults objectForKey:UserLocation];
    
    return location;

}

+ (void)saveSSIDMac:(NSString *)macAddress
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setValue:macAddress forKey:SSIDMacAddress];
    [defaults synchronize];
}

+ (NSString *)getSaveSSIDMac
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSString *ssidMac = [defaults objectForKey:SSIDMacAddress];
    
    return ssidMac;
}

@end
